///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun  5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP

#include "WorkFieldPanel.h"

#include "BaseMainFrame.h"

///////////////////////////////////////////////////////////////////////////

BaseMainFrame::BaseMainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_mainMenu = new wxMenuBar( 0 );
	m_fileMenu = new wxMenu();
	wxMenuItem* m_menuFileNew;
	m_menuFileNew = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_NEW, wxString( wxT("&New") ) + wxT('\t') + wxT("Ctrl+N"), wxT("Creates new file"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuFileNew->SetBitmaps( wxArtProvider::GetBitmap( wxART_NEW, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileNew->SetBitmap( wxArtProvider::GetBitmap( wxART_NEW, wxART_MENU ) );
	#endif
	m_fileMenu->Append( m_menuFileNew );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_menuFileOpen;
	m_menuFileOpen = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_OPEN, wxString( wxT("&Open") ) + wxT('\t') + wxT("Ctrl+O"), wxT("Opens a file"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuFileOpen->SetBitmaps( wxArtProvider::GetBitmap( wxART_FILE_OPEN, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileOpen->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_OPEN, wxART_MENU ) );
	#endif
	m_fileMenu->Append( m_menuFileOpen );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_menuFileSave;
	m_menuFileSave = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_SAVE, wxString( wxT("&Save") ) + wxT('\t') + wxT("Ctrl+S"), wxT("Saves a file"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuFileSave->SetBitmaps( wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileSave->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_MENU ) );
	#endif
	m_fileMenu->Append( m_menuFileSave );
	
	wxMenuItem* m_menuFileSaveAs;
	m_menuFileSaveAs = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_SAVE_AS, wxString( wxT("SaveAs") ) , wxT("Saves a file as"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuFileSaveAs->SetBitmaps( wxArtProvider::GetBitmap( wxART_FILE_SAVE_AS, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileSaveAs->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_SAVE_AS, wxART_MENU ) );
	#endif
	m_fileMenu->Append( m_menuFileSaveAs );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_menuFileClose;
	m_menuFileClose = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_CLOSE, wxString( wxT("Close") ) , wxT("Closes file"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuFileClose->SetBitmaps( wxArtProvider::GetBitmap( wxART_CROSS_MARK, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileClose->SetBitmap( wxArtProvider::GetBitmap( wxART_CROSS_MARK, wxART_MENU ) );
	#endif
	m_fileMenu->Append( m_menuFileClose );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_menuFileQuit;
	m_menuFileQuit = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_QUIT, wxString( wxT("&Quit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Quit the application"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuFileQuit->SetBitmaps( wxArtProvider::GetBitmap( wxART_QUIT, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileQuit->SetBitmap( wxArtProvider::GetBitmap( wxART_QUIT, wxART_MENU ) );
	#endif
	m_fileMenu->Append( m_menuFileQuit );
	
	m_mainMenu->Append( m_fileMenu, wxT("&File") ); 
	
	m_editMenu = new wxMenu();
	wxMenuItem* m_menuUndo;
	m_menuUndo = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_UNDO, wxString( wxT("&Undo") ) + wxT('\t') + wxT("Ctrl+Z"), wxEmptyString, wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuUndo->SetBitmaps( wxArtProvider::GetBitmap( wxART_UNDO, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuUndo->SetBitmap( wxArtProvider::GetBitmap( wxART_UNDO, wxART_MENU ) );
	#endif
	m_editMenu->Append( m_menuUndo );
	
	wxMenuItem* m_menuRedo;
	m_menuRedo = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_REDO, wxString( wxT("Re&do") ) + wxT('\t') + wxT("Ctrl+Y"), wxEmptyString, wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuRedo->SetBitmaps( wxArtProvider::GetBitmap( wxART_REDO, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuRedo->SetBitmap( wxArtProvider::GetBitmap( wxART_REDO, wxART_MENU ) );
	#endif
	m_editMenu->Append( m_menuRedo );
	
	m_editMenu->AppendSeparator();
	
	wxMenuItem* m_menuCut;
	m_menuCut = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_CUT, wxString( wxT("Cut") ) + wxT('\t') + wxT("Ctrl+X"), wxEmptyString, wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuCut->SetBitmaps( wxArtProvider::GetBitmap( wxART_CUT, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuCut->SetBitmap( wxArtProvider::GetBitmap( wxART_CUT, wxART_MENU ) );
	#endif
	m_editMenu->Append( m_menuCut );
	
	wxMenuItem* m_menuCopy;
	m_menuCopy = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_COPY, wxString( wxT("Copy") ) + wxT('\t') + wxT("Ctrl+C"), wxEmptyString, wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuCopy->SetBitmaps( wxArtProvider::GetBitmap( wxART_COPY, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuCopy->SetBitmap( wxArtProvider::GetBitmap( wxART_COPY, wxART_MENU ) );
	#endif
	m_editMenu->Append( m_menuCopy );
	
	wxMenuItem* m_menuPaste;
	m_menuPaste = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_PASTE, wxString( wxT("Paste") ) + wxT('\t') + wxT("Ctrl+V"), wxEmptyString, wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuPaste->SetBitmaps( wxArtProvider::GetBitmap( wxART_PASTE, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuPaste->SetBitmap( wxArtProvider::GetBitmap( wxART_PASTE, wxART_MENU ) );
	#endif
	m_editMenu->Append( m_menuPaste );
	
	wxMenuItem* m_menuDelete;
	m_menuDelete = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_DELETE, wxString( wxT("Delete") ) + wxT('\t') + wxT("Del"), wxEmptyString, wxITEM_NORMAL );
	#ifdef __WXMSW__
	m_menuDelete->SetBitmaps( wxArtProvider::GetBitmap( wxART_DELETE, wxART_MENU ) );
	#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuDelete->SetBitmap( wxArtProvider::GetBitmap( wxART_DELETE, wxART_MENU ) );
	#endif
	m_editMenu->Append( m_menuDelete );
	
	m_mainMenu->Append( m_editMenu, wxT("&Edit") ); 
	
	m_helpMenu = new wxMenu();
	wxMenuItem* m_menuHelpAbout;
	m_menuHelpAbout = new wxMenuItem( m_helpMenu, MAIN_MENU_ABOUT, wxString( wxT("&About") ) + wxT('\t') + wxT("F1"), wxT("Show info about this application"), wxITEM_NORMAL );
	m_helpMenu->Append( m_menuHelpAbout );
	
	m_mainMenu->Append( m_helpMenu, wxT("&Help") ); 
	
	this->SetMenuBar( m_mainMenu );
	
	m_toolBarMain = this->CreateToolBar( wxTB_HORIZONTAL, MAIN_TOOLBAR ); 
	m_toolNew = m_toolBarMain->AddTool( MAIN_TOOLBAR_NEW, wxT("New"), wxArtProvider::GetBitmap( wxART_NEW, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT("New file"), wxT("Creates a new resource file"), NULL ); 
	
	m_toolOpen = m_toolBarMain->AddTool( MAIN_TOOLBAR_OPEN, wxT("Open"), wxArtProvider::GetBitmap( wxART_FILE_OPEN, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT("Open file"), wxT("Open existing resource file"), NULL ); 
	
	m_toolSave = m_toolBarMain->AddTool( MAIN_TOOLBAR_SAVE, wxT("Save"), wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT("Save file"), wxT("Save resource file"), NULL ); 
	
	m_toolBarMain->AddSeparator(); 
	
	m_toolUndo = m_toolBarMain->AddTool( MAIN_TOOLBAR_UNDO, wxT("Undo"), wxArtProvider::GetBitmap( wxART_UNDO, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT("Undo"), wxT("Undo the last action"), NULL ); 
	
	m_toolRedo = m_toolBarMain->AddTool( MAIN_TOOLBAR_REDO, wxT("Redo"), wxArtProvider::GetBitmap( wxART_REDO, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT("Redo"), wxT("Redo the last action"), NULL ); 
	
	m_toolBarMain->AddSeparator(); 
	
	m_toolCut = m_toolBarMain->AddTool( MAIN_TOOLBAR_CUT, wxT("Cut"), wxArtProvider::GetBitmap( wxART_CUT, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	
	m_toolCopy = m_toolBarMain->AddTool( MAIN_TOOLBAR_COPY, wxT("tool"), wxArtProvider::GetBitmap( wxART_COPY, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	
	m_toolPaste = m_toolBarMain->AddTool( MAIN_TOOLBAR_PASTE, wxT("tool"), wxArtProvider::GetBitmap( wxART_PASTE, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	
	m_toolDelete = m_toolBarMain->AddTool( MAIN_TOOLBAR_DELETE, wxT("tool"), wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	
	m_toolBarMain->Realize(); 
	
	statusBar = this->CreateStatusBar( 2, wxST_SIZEGRIP, wxID_ANY );
	wxBoxSizer* bSizer;
	bSizer = new wxBoxSizer( wxHORIZONTAL );
	
	m_toolBar3 = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_DOCKABLE|wxTB_FLAT|wxTB_VERTICAL ); 
	m_toolPolygon = m_toolBar3->AddTool( wxID_ANY, wxT("Polygon"), wxArtProvider::GetBitmap( wxART_MISSING_IMAGE, wxART_TOOLBAR ), wxNullBitmap, wxITEM_RADIO, wxEmptyString, wxEmptyString, NULL ); 
	
	m_toolCircle = m_toolBar3->AddTool( wxID_ANY, wxT("Circle"), wxArtProvider::GetBitmap( wxART_MISSING_IMAGE, wxART_TOOLBAR ), wxNullBitmap, wxITEM_RADIO, wxEmptyString, wxEmptyString, NULL ); 
	
	m_tool12 = m_toolBar3->AddTool( wxID_ANY, wxT("tool"), wxArtProvider::GetBitmap( wxART_MISSING_IMAGE, wxART_TOOLBAR ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	
	m_tool13 = m_toolBar3->AddTool( wxID_ANY, wxT("tool"), wxArtProvider::GetBitmap( wxART_MISSING_IMAGE, wxART_TOOLBAR ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL ); 
	
	m_toolBar3->Realize(); 
	
	bSizer->Add( m_toolBar3, 0, wxEXPAND, 5 );
	
	m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
	m_splitter->Connect( wxEVT_IDLE, wxIdleEventHandler( BaseMainFrame::m_splitterOnIdle ), NULL, this );
	
	m_splitter->SetMinSize( wxSize( 300,100 ) );
	
	m_workFieldPanel = new WorkFieldPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxSize( 3,-1 ), wxTAB_TRAVERSAL );
	m_workFieldPanel->SetBackgroundColour( wxColour( 255, 255, 255 ) );
	m_workFieldPanel->SetMinSize( wxSize( 200,100 ) );
	
	m_propertyPanel = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxSize( 1,-1 ), wxTAB_TRAVERSAL );
	m_propertyPanel->SetMinSize( wxSize( 100,100 ) );
	
	wxBoxSizer* bPropertiesSizer;
	bPropertiesSizer = new wxBoxSizer( wxHORIZONTAL );
	
	m_propertyGrid = new wxPropertyGrid(m_propertyPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPG_DEFAULT_STYLE);
	m_propertyGrid->SetMinSize( wxSize( 100,100 ) );
	
	bPropertiesSizer->Add( m_propertyGrid, 1, wxEXPAND, 0 );
	
	
	m_propertyPanel->SetSizer( bPropertiesSizer );
	m_propertyPanel->Layout();
	m_splitter->SplitVertically( m_workFieldPanel, m_propertyPanel, 0 );
	bSizer->Add( m_splitter, 1, wxEXPAND, 5 );
	
	
	this->SetSizer( bSizer );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BaseMainFrame::OnExit ) );
	this->Connect( m_menuFileNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ) );
	this->Connect( m_menuFileOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ) );
	this->Connect( m_menuFileSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ) );
	this->Connect( m_menuFileSaveAs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSaveAs ) );
	this->Connect( m_menuFileClose->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnClose ) );
	this->Connect( m_menuFileQuit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnQuit ) );
	this->Connect( m_menuHelpAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnAbout ) );
	this->Connect( m_toolNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ));
	this->Connect( m_toolOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ));
	this->Connect( m_toolSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ));
	this->Connect( m_toolUndo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnUndo ));
	this->Connect( m_toolRedo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnRedo ));
}

BaseMainFrame::~BaseMainFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BaseMainFrame::OnExit ) );
	this->Disconnect( MAIN_MENU_FILE_NEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ) );
	this->Disconnect( MAIN_MENU_FILE_OPEN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ) );
	this->Disconnect( MAIN_MENU_FILE_SAVE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ) );
	this->Disconnect( MAIN_MENU_FILE_SAVE_AS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSaveAs ) );
	this->Disconnect( MAIN_MENU_FILE_CLOSE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnClose ) );
	this->Disconnect( MAIN_MENU_FILE_QUIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnQuit ) );
	this->Disconnect( MAIN_MENU_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnAbout ) );
	this->Disconnect( m_toolNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ));
	this->Disconnect( m_toolOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ));
	this->Disconnect( m_toolSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ));
	this->Disconnect( m_toolUndo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnUndo ));
	this->Disconnect( m_toolRedo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnRedo ));
	
}
